﻿<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Site.Master" CodeBehind="BlogDetails.aspx.vb" Inherits="Universities.BlogDetails" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <asp:Repeater ID="Repeater1" runat="server" DataSourceID="SqlDataSource1">
    <ItemTemplate>
    <div style="color:Black">
     <h1 style="background-color:Maroon; color:White"><%# Eval("Tittle")%></h1>
     <hr />
     <p><%# Eval("Description")%></p>
     <p style="text-align:right">posted By <%# Eval("UserName")%></p>
     <p style="text-align:right">on <%# Eval("PostDate")%></p>
    </div>
    </ItemTemplate>
    </asp:Repeater>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
        ConnectionString="<%$ ConnectionStrings:UniConnectionString %>" 
        ProviderName="<%$ ConnectionStrings:UniConnectionString.ProviderName %>" 
        SelectCommand="SELECT [Tittle], [Description], [PostDate], [UserName] FROM [Qry_View_Blog_Articles] WHERE ([ID] = ?)">
        <SelectParameters>
            <asp:QueryStringParameter Name="ID" QueryStringField="ID" Type="Int32" />
        </SelectParameters>
    </asp:SqlDataSource>
    <br />
    <hr style="width:50%" />
    <br />
    <asp:TextBox ID="Txt_Comment_Article" runat="server" Height="73px" 
        TextMode="MultiLine" ToolTip="Please type your comment here" Width="100%" 
        Wrap="False"></asp:TextBox>
    <br />
    <asp:Button ID="btn_Submit_Comment_Article" runat="server" 
        Text="Submit Comment" />
    <br />
    <div>
    <p style="background-color:Green; font-weight:bold; color:White">User Comments</p>
        <asp:Repeater ID="Repeater2" runat="server" DataSourceID="SqlDataSource2">
        <ItemTemplate> 
            <table style="width: 100%;">
                <tr>
                    <td valign="top" style="width:25%">
                       Comment By <%# Eval("UserName")%><br />
                       <%# Eval("Comment_Date")%>
                    </td>
                    <td valign="top" align="left">
                        <%# Eval("Comment_Article")%>
                    </td>
                </tr>
            </table>           
                <hr />                                     
        </ItemTemplate>
        </asp:Repeater>
        <asp:SqlDataSource ID="SqlDataSource2" runat="server" 
            ConnectionString="<%$ ConnectionStrings:UniConnectionString %>" 
            ProviderName="<%$ ConnectionStrings:UniConnectionString.ProviderName %>" 
            SelectCommand="SELECT * FROM [Qry_blog_Comments_Articles_Condition] WHERE ([ArticleID] = ?)">
            <SelectParameters>
                <asp:QueryStringParameter Name="ArticleID" QueryStringField="ID" Type="Int32" 
                    DefaultValue="" />
            </SelectParameters>
        </asp:SqlDataSource>
        <br />
        <br />
    </div>
</asp:Content>
